package com.hyt.it.ogt.ykcj.service.grade.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.hyt.it.ogt.ykcj.common.utils.DateUtils;
import com.hyt.it.ogt.ykcj.domain.grade.ServantSubjectPtGradeAnalysisData;
import com.hyt.it.ogt.ykcj.mapper.grade.ServantSubjectPtGradeAnalysisDataMapper;
import com.hyt.it.ogt.ykcj.service.grade.IServantSubjectPtGradeAnalysisDataService;

/**
 * 公务员考试科目层级成绩数据分析Service业务层处理
 * 
 * @author admin
 * @date 2021-10-13
 */
@Service
public class ServantSubjectPtGradeAnalysisDataServiceImpl implements
        IServantSubjectPtGradeAnalysisDataService
{
    @Autowired
    private ServantSubjectPtGradeAnalysisDataMapper servantSubjectPtGradeAnalysisDataMapper;

    /**
     * 查询公务员考试科目层级成绩数据分析
     *
     * @param id 公务员考试科目层级成绩数据分析ID
     * @return 公务员考试科目层级成绩数据分析
     */
    @Override
    public ServantSubjectPtGradeAnalysisData selectServantSubjectPtGradeAnalysisDataById(String id)
    {
        return servantSubjectPtGradeAnalysisDataMapper.selectServantSubjectPtGradeAnalysisDataById(id);
    }

    /**
     * 查询公务员考试科目层级成绩数据分析列表
     *
     * @param servantSubjectPtGradeAnalysisData 公务员考试科目层级成绩数据分析
     * @return 公务员考试科目层级成绩数据分析
     */
    @Override
    public List<ServantSubjectPtGradeAnalysisData> selectServantSubjectPtGradeAnalysisDataList(ServantSubjectPtGradeAnalysisData servantSubjectPtGradeAnalysisData)
    {
        return servantSubjectPtGradeAnalysisDataMapper.selectServantSubjectPtGradeAnalysisDataList(servantSubjectPtGradeAnalysisData);
    }


    /**
     * 查询公务员考试科目层级题型平均分
     *
     * @param servantSubjectPtGradeAnalysisData 公务员考试科目层级成绩数据分析
     * @return 公务员考试科目层级成绩数据分析
     */
    @Override
    public List<ServantSubjectPtGradeAnalysisData> selectAvgScoreByStem(ServantSubjectPtGradeAnalysisData servantSubjectPtGradeAnalysisData) {
        return servantSubjectPtGradeAnalysisDataMapper.selectAvgScoreByStem(servantSubjectPtGradeAnalysisData);
    }

    /**
     * 新增公务员考试科目层级成绩数据分析
     *
     * @param servantSubjectPtGradeAnalysisData 公务员考试科目层级成绩数据分析
     * @return 结果
     */
    @Override
    public int insertServantSubjectPtGradeAnalysisData(ServantSubjectPtGradeAnalysisData servantSubjectPtGradeAnalysisData)
    {
        servantSubjectPtGradeAnalysisData.setCreateTime(DateUtils.getNowDate());
        return servantSubjectPtGradeAnalysisDataMapper.insertServantSubjectPtGradeAnalysisData(servantSubjectPtGradeAnalysisData);
    }

    @Override
    public int batchInsertServantSubjectPtGradeAnalysisData(List<ServantSubjectPtGradeAnalysisData> list) {
        return servantSubjectPtGradeAnalysisDataMapper.batchInsertServantSubjectPtGradeAnalysisData(list);
    }

    /**
     * 修改公务员考试科目层级成绩数据分析
     *
     * @param servantSubjectPtGradeAnalysisData 公务员考试科目层级成绩数据分析
     * @return 结果
     */
    @Override
    public int updateServantSubjectPtGradeAnalysisData(ServantSubjectPtGradeAnalysisData servantSubjectPtGradeAnalysisData)
    {
        servantSubjectPtGradeAnalysisData.setUpdateTime(DateUtils.getNowDate());
        return servantSubjectPtGradeAnalysisDataMapper.updateServantSubjectPtGradeAnalysisData(servantSubjectPtGradeAnalysisData);
    }

    /**
     * 批量删除公务员考试科目层级成绩数据分析
     *
     * @param ids 需要删除的公务员考试科目层级成绩数据分析ID
     * @return 结果
     */
    @Override
    public int deleteServantSubjectPtGradeAnalysisDataByIds(String[] ids)
    {
        return servantSubjectPtGradeAnalysisDataMapper.deleteServantSubjectPtGradeAnalysisDataByIds(ids);
    }

    /**
     * 删除公务员考试科目层级成绩数据分析信息
     *
     * @param id 公务员考试科目层级成绩数据分析ID
     * @return 结果
     */
    @Override
    public int deleteServantSubjectPtGradeAnalysisDataById(String id)
    {
        return servantSubjectPtGradeAnalysisDataMapper.deleteServantSubjectPtGradeAnalysisDataById(id);
    }

    @Override
    public int delete(ServantSubjectPtGradeAnalysisData data) {
        return servantSubjectPtGradeAnalysisDataMapper.delete(data);
    }
}
